package com.xnyzc.lhy.common.penum.cms.veh;

/**
 * @Description 车辆燃油类型
 * @Author zhuyubin
 * @Date 2019-08-26 16:22
 **/
public enum EVehFuelType {

    electric(0, "纯电动"),
    tanker(1, "汽油"),
    diesel(2, "柴油"),
    hybird(3, "油电混动"),
    plugIn(4, "插电式混动");

    private Integer value;
    private String desc;

    EVehFuelType(Integer value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public static EVehFuelType findById(Integer value){
        EVehFuelType eVehFuelType;
        switch (value){
            case 0:
                eVehFuelType  = EVehFuelType.electric;
                break;
            case 1:
                eVehFuelType = EVehFuelType.tanker;
                break;
            case 2:
                eVehFuelType = EVehFuelType.diesel;
                break;
            case 3:
                eVehFuelType = EVehFuelType.hybird;
                break;
            case 4:
                eVehFuelType = EVehFuelType.plugIn;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eVehFuelType;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
